#!/bin/bash

## Push local changes to github

echo -e "${BOLD}${COLOR}CodeIgniter4 release deployment${NORMAL}"
echo '-------------------------------'

. admin/release-config

echo -e "${BOLD}Merge release into develop${NORMAL}"
git checkout develop
git merge $branch
git push origin develop
git push ${CI_ORG}/CodeIgniter4 develop

echo -e "${BOLD}Merge develop into master${NORMAL}"
git checkout master
git merge develop
git push origin master
git push ${CI_ORG}/CodeIgniter4 master

echo -e "${BOLD}Pushing to the user guide repository${NORMAL}"
cd ${CI_DIR}/dist/userguide
git push origin master

echo -e "${BOLD}Pushing to the framework repository${NORMAL}"
cd ${CI_DIR}/dist/framework
git push origin master

echo -e "${BOLD}Pushing to the app starter repository${NORMAL}"
cd ${CI_DIR}/dist/appstarter
git push origin master

cd ${CI_DIR}

#---------------------------------------------------
# Phew!
echo -e "${BOLD}Congratulations - we have liftoff${NORMAL}"
echo "Don't forget to announce this release on the forum and on twitter!"
